#
#
# Generic Makefile for PerlClass and tests
#
#

CC = cc
CFLAGS = -g
LFLAGS =

# uncomment the next file if your USL front end breaks enums
#DEFS = -DUSLCOMPILER

perltest: perltest.o tperlclass.o regex.o
	$(CC) $(CFLAGS) $(LFLAGS) -DTEST -o perltest perltest.c++ tperlclass.o regex.o

tperlclass.o: perlclass.c++
	$(CC) $(CFLAGS) $(DEFS) -DTEST -c perlclass.c++
	mv perlclass.o tperlclass.o

tperlclass.o perlclass.o: marray.h perlclass.h regexp.h
regex.o: regex.h

perlassoc: perlassoc.c++ perlclass.o regex.o
	$(CC) $(CFLAGS) $(LFLAGS) $(DEFS) -DTESTASSOC perlassoc.c++ perlclass.o regex.o -o perlassoc

test:
	perltest > x
	diff x perlclass.v

chgfnt: chgfnt.o perlclass.o regex.o
	$(CC) $(CFLAGS) $(DEFS)  -DTESTCHGFNT  chgfnt.c++ perlclass.o regex.o -o chgfnt
	
